package main

import "fmt"

/*
* Author: JacksonCoder
* CreateTime: 2025/5/18
 */
type Person struct{
	Name string
	Age int
}

type Student2 struct{
	score string
	Age int
	Person // 匿名内嵌结构体
}

func main(){

	var stu = new(Student2)
	stu.Age = 22       // 优先选择Student中的Age
	fmt.Println(stu.Person.Age, stu.Age) // 0 , 22

	var stu2 = Student2{
		score: "100",
		Age:   20,
		Person: Person{
			Name: "柚子老师",
			Age:  18,
		},
	}
	fmt.Println("stu2: ", stu2)

}